
//#pragma once
#ifndef RTMP_INCLUDE_PROCESS_H_
#define RTMP_INCLUDE_PROCESS_H_

#ifndef RTMP_INCLUDE_MESSAGE_H_
#include "rtmp_message.h"
#endif
#include <memory>

class RtmpConnection;
class RtmpMediaResource;
class RtmpMediaResourceMgr;
class RtmpMsgProceess
{
public:
    RtmpMsgProceess();
    ~RtmpMsgProceess();
    void Process(std::shared_ptr<RtmpConnection> conn, std::shared_ptr<RtmpMessage> & req);
private:
    void ProcessCommand(std::shared_ptr<RtmpConnection> conn, std::shared_ptr<RtmpMessage> & req);
    void ConnectCommand(std::shared_ptr<RtmpConnection> conn, std::shared_ptr<RtmpMessage> & msg);
    void ReleaseStreamCommand(std::shared_ptr<RtmpConnection> conn, std::shared_ptr<RtmpMessage> & msg);
    void FCPublishCommand(std::shared_ptr<RtmpConnection> conn, std::shared_ptr<RtmpMessage> & msg);
    void CreateStreamCommand(std::shared_ptr<RtmpConnection> conn, std::shared_ptr<RtmpMessage> & msg);
    void PublishCommand(std::shared_ptr<RtmpConnection> conn, std::shared_ptr<RtmpMessage> & msg);

    void SetDataFrame(std::shared_ptr<RtmpConnection> conn, std::shared_ptr<RtmpMessage> & msg);
    void AudioFrame(std::shared_ptr<RtmpConnection>   conn, std::shared_ptr<RtmpMessage> & msg);
    void VideoFrame(std::shared_ptr<RtmpConnection>   conn, std::shared_ptr<RtmpMessage> & msg);
    bool CheckConnPower(std::shared_ptr<RtmpConnection> conn);

    void OnStatusCommand(std::shared_ptr<RtmpConnection> conn, std::shared_ptr<RtmpMessage> & msg);
    void SetChunkSize(std::shared_ptr<RtmpConnection> conn, std::shared_ptr<RtmpMessage> & msg);
	void GetStreamLength(std::shared_ptr<RtmpConnection> conn, std::shared_ptr<RtmpMessage> & msg);
	void PlayStreamCommand(std::shared_ptr<RtmpConnection> conn, std::shared_ptr<RtmpMessage> & msg);
private:
    RtmpMediaResourceMgr * m_resource_manager;
};



#endif
